home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / intlb010.zip / DEMO.CP_ / DEMO.bin
Text File  |  1995-02-04  |  33KB  |  756 lines

  1. // Copyright Maccani Maurizio 1994 All rights reserved
  2. #include <windows.h>
  3. #include <windowsx.h>
  4. #include <stdlib.h>
  5. #include "trainplb.h"
  6. #include "demo.h"
  7. #include "csh.h"
  8. #include "interLib.h" // This include is needed to use the library
  9.  
  10. // language definitions
  11. HINSTANCE       intLib;
  12. HINSTANCE       training;
  13.  
  14. BOOL FAR PASCAL __export ShowDetailsDialogProc(HWND hDlg, UINT uMsg,
  15.                                               WPARAM wParam, LPARAM lParam);
  16. long FAR PASCAL _export TestProc(HWND hwnd, UINT message, UINT wParam,
  17.                                                  LONG lParam);
  18. BOOL CALLBACK _export FindChildWindowsProc(HWND hwnd, LPARAM k);
  19. HINSTANCE       hInst;
  20. BOOL FAR PASCAL __export TestDialogProc(HWND hDlg, UINT uMsg,
  21.                                               WPARAM wParam, LPARAM lParam);
  22.  
  23. BOOL FAR PASCAL __export TestDialog1Proc(HWND hDlg, UINT uMsg,
  24.                                               WPARAM wParam, LPARAM lParam);
  25.  
  26. int PASCAL      WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
  27.                                         LPSTR lpszCmdParam, int nCmdShow)
  28. {  
  29.     MSG             msg;
  30.     WNDCLASS        wndclass;
  31.     hInst = hInstance;
  32.     wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_BYTEALIGNWINDOW | CS_BYTEALIGNCLIENT | CS_GLOBALCLASS | CS_DBLCLKS;
  33.     wndclass.cbClsExtra = 0;
  34.     wndclass.cbWndExtra = 18;
  35.     wndclass.hInstance = hInstance;
  36.     wndclass.hIcon = LoadIcon(hInstance, "icon");
  37.     wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
  38.     wndclass.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
  39.     wndclass.lpszMenuName = "menu";
  40.     wndclass.lpfnWndProc = TestProc;
  41.     wndclass.lpszClassName = "test";
  42.     RegisterClass(&wndclass);
  43.     /**********************************************/
  44.     /* Remember to load the DLL                   */
  45.     /**********************************************/
  46.  
  47.     intLib = LoadLibrary("interlib.dll");
  48.     int             ret = SetHelpFile(".\\HELP\\interlib.HLP");
  49.     if (ret == HELP_FILE_DO_NOT_EXISTS)
  50.         MessageBox(NULL, "Not existing Help File", "Error", MB_ICONSTOP | MB_OK);
  51.     HWND            hwndHello = CreateWindow("test",    // window class name
  52.                                              "Test International Library",      // window caption
  53.                                              WS_OVERLAPPEDWINDOW,       // window style
  54.                                              100, 100, 350, 320,
  55.                                              NULL,      // parent window handle
  56.                                              NULL,      // window menu handle
  57.                                              (HINSTANCE) hInstance,     // program instance
  58.                                                                         // handle
  59.                                              NULL);     // creation parameters
  60.     ShowWindow(hwndHello, SW_SHOW);
  61.     UpdateWindow(hwndHello);
  62.     training = LoadLibrary("training\\stpredis.dll");
  63.     Playback = (PLAYBACK) GetProcAddress(training,"Playback");
  64.     SetDefaultHelp(0x0040);
  65.     SetWindowHelp(hwndHello, 0x0040);
  66.     while (GetMessage(&msg, NULL, 0, 0)) {
  67.         TranslateMessage(&msg);
  68.         DispatchMessage(&msg);
  69.     }
  70.     FreeLibrary(intLib);
  71.     FreeLibrary(training);
  72.     return msg.wParam;
  73. }
  74. #define OK 100
  75. void            DestroySubwindow(HWND);
  76. long FAR PASCAL _export TestProc(HWND hwnd, UINT message, UINT wParam,
  77.                                                  LONG lParam)
  78. {
  79.     static int      mode;
  80.     static HWND     PosCurrency,
  81.                     PosZeroCurrency,
  82.                     NegCurrency,
  83.                     NegZeroCurrency;
  84.     static HWND     PosNumber,
  85.                     PosZeroNumber;
  86.     static HWND     NumberS,
  87.                     ZeroNumberS,
  88.                     NegNumber;
  89.     static HWND     date,
  90.                     currency,
  91.                     Number,
  92.                     timeV,
  93.                     timeV1,
  94.                     timeV2,
  95.                     date1;
  96.     switch (message) {
  97.     case WM_CREATE:
  98.         SetMenuHelp(hwnd, EXIT, 0x0083);
  99.         SetMenuHelp(hwnd, CURRENCY, 0x0035);
  100.         SetMenuHelp(hwnd, TIME, 0x0038);
  101.         SetMenuHelp(hwnd, NUMBER, 0x0036);
  102.         SetMenuHelp(hwnd, DATE, 0x0037);
  103.         SetMenuHelp(hwnd, DETAILS_DIALOG, 0x0084);
  104.         SetMenuHelp(hwnd, CALL_DIALOG, 0x0085);
  105.         SetMenuHelp(hwnd, CALL_DIALOG1, 0x0085);
  106.         SetMenuHelp(hwnd, ITALIAN, 0x0086);
  107.         SetMenuHelp(hwnd, FRENCH, 0x0086);
  108.         SetMenuHelp(hwnd, GERMAN, 0x0086);
  109.         SetMenuHelp(hwnd, ENGLISH, 0x0086);
  110.         SetMenuHelp(hwnd, SPANISH, 0x0086);
  111.         SetMenuHelp(hwnd, PORTUGUESE, 0x0086);
  112.         SetMenuHelp(hwnd, EXIT, 0x0083);
  113.         SetMenuHelp(hwnd, EXIT, 0x0083);
  114.         SetMenuHelp(hwnd, EXIT, 0x0083);
  115.         SetMenuHelp(hwnd, CURRENCY_HELP, 0x0087);
  116.         SetMenuHelp(hwnd, NUMBER_HELP, 0x0087);
  117.         SetMenuHelp(hwnd, TIME_HELP, 0x0087);
  118.         SetMenuHelp(hwnd, DATE_HELP, 0x0087);
  119.         SetMenuHelp(hwnd, INTRODUCTION_HELP, 0x0087);
  120.         SetMenuHelp(hwnd, ABOUT_HELP, 0x0087);
  121.         SetMenuHelp(hwnd, PRINT, 0x0088);
  122.         SetMenuHelp(hwnd, DEMO, 0x0089);
  123.         SetWindowHelp(hwnd, 0x0040);
  124.  
  125.         mode = 0;
  126.         return 0;
  127.     case WM_DESTROY:
  128.         PostQuitMessage(0);
  129.         return 0;
  130.     case WM_COMMAND:
  131.         {
  132.             switch (wParam) {
  133.             case EXIT:
  134.                 PostQuitMessage(0);
  135.                 return 0;
  136.             case CHANGE_TIMEZONE:
  137.                 SetEnvTime((LPCSTR) "PST8PDT");
  138.                 return 0;
  139.             case CURRENCY:
  140.                 {
  141.                     DestroySubwindow(hwnd);
  142.                     PosCurrency = CreateWindow("Currency", "545,3", WS_BORDER | WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL, 120, 20, 100, 25, hwnd, 1, hInst, NULL);
  143.                     PosZeroCurrency = CreateWindow("Currency", "", WS_BORDER | WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL, 120, 50, 100, 25, hwnd, 1, hInst, NULL);
  144.                     NegCurrency = CreateWindow("Currency", "-545,3", WS_BORDER | WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL, 120, 80, 100, 25, hwnd, 1, hInst, NULL);
  145.                     NegZeroCurrency = CreateWindow("Currency", "-", WS_BORDER | WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL, 120, 110, 100, 25, hwnd, 1, hInst, NULL);
  146.                     SetWindowHelp(PosCurrency, 0x0067);
  147.                     SetWindowHelp(PosZeroCurrency, 0x0068);
  148.                     SetWindowHelp(NegCurrency, 0x0070);
  149.                     SetWindowHelp(NegZeroCurrency, 0x0071);
  150.  
  151.                     HWND            PosCurrencyS = CreateWindow("Static", "Pos. Currency", WS_CHILD | WS_VISIBLE, 10, 20, 100, 25, hwnd, 1, hInst, NULL);
  152.                     HWND            PosZeroCurrencyS = CreateWindow("Static", "Pos.0 Currency", WS_CHILD | WS_VISIBLE, 10, 50, 100, 25, hwnd, 1, hInst, NULL);
  153.                     HWND            NegCurrencyS = CreateWindow("Static", "Neg. Currency", WS_CHILD | WS_VISIBLE, 10, 80, 100, 25, hwnd, 1, hInst, NULL);
  154.                     HWND            NegZeroCurrencyS = CreateWindow("Static", "Neg.0 Currency", WS_CHILD | WS_VISIBLE, 10, 110, 100, 25, hwnd, 1, hInst, NULL);
  155.                     UpdateWindow(hwnd);
  156.                     mode = 1;
  157.                     return 0;
  158.                 }
  159.             case DATE:
  160.                 {
  161.                     DestroySubwindow(hwnd);
  162.                     date = CreateWindow("Date", "", WS_BORDER | WS_CHILD | WS_VISIBLE, 120, 20, 100, 25, hwnd, 1, hInst, NULL);
  163.                     date1 = CreateWindow("Date", "", DS_AUTODATE | WS_BORDER | WS_CHILD | WS_VISIBLE, 120, 50, 100, 25, hwnd, 1, hInst, NULL);
  164.                     HWND            date2 = CreateWindow("Date", "", WS_BORDER | WS_CHILD | WS_VISIBLE, 120, 80, 100, 25, hwnd, 1, hInst, NULL);
  165.                     SetWindowHelp(date, 0x0072);
  166.                     SetWindowHelp(date1,0x0073);
  167.                     SetWindowHelp(date2,0x0074);
  168.                     HWND            dateS = CreateWindow("Static", "Date", WS_CHILD | WS_VISIBLE, 10, 20, 100, 25, hwnd, 1, hInst, NULL);
  169.                     HWND            dateVSS = CreateWindow("Static", "AutoDate", WS_CHILD | WS_VISIBLE, 10, 50, 100, 25, hwnd, 1, hInst, NULL);
  170.                     HWND            dateBSS = CreateWindow("Static", "Zero Date", WS_CHILD | WS_VISIBLE, 10, 80, 100, 25, hwnd, 1, hInst, NULL);
  171.                     _timezone = 0;
  172.                     _daylight = 0;
  173.                     time_t          t;
  174.                     time(&t);
  175.                     SetDateTime_t(date, t);
  176.                     UpdateWindow(hwnd);
  177.                     mode = 3;
  178.                     return 0;
  179.                 }
  180.             case DETAILS_DIALOG:
  181.                 {
  182.                     DLGPROC         showDetailsDialogProc;
  183.                     showDetailsDialogProc = (DLGPROC) MakeProcInstance((FARPROC) ShowDetailsDialogProc, hInst);
  184.                     int             ShowDetails = DialogBox(hInst, "ShowDetails", hwnd, showDetailsDialogProc);
  185.                     FreeProcInstance(showDetailsDialogProc);
  186.                     return 0;
  187.                 }
  188.             case CALL_DIALOG:
  189.                 {
  190.                     DLGPROC         testDialogProc;
  191.                     testDialogProc = (DLGPROC) MakeProcInstance((FARPROC) TestDialogProc, hInst);
  192.                     int             Test = DialogBox(hInst, "DialogTest", hwnd, testDialogProc);
  193.                     FreeProcInstance(testDialogProc);
  194.                     return 0;
  195.                 }
  196.             case CALL_DIALOG1:
  197.                 {
  198.                     DLGPROC         testDialogProc;
  199.                     testDialogProc = (DLGPROC) MakeProcInstance((FARPROC) TestDialog1Proc, hInst);
  200.                     int             Test = DialogBox(hInst, "DialogTest1", hwnd, testDialogProc);
  201.                     FreeProcInstance(testDialogProc);
  202.                     return 0;
  203.                 }
  204.             case TIME:
  205.                 {
  206.                     DestroySubwindow(hwnd);
  207.                     timeV = CreateWindow("Time", "", WS_BORDER | WS_CHILD | WS_VISIBLE, 120, 20, 130, 25, hwnd, 1, hInst, NULL);
  208.                     timeV1 = CreateWindow("Time", "", TS_SECONDS | WS_BORDER | WS_CHILD | WS_VISIBLE, 120, 50, 130, 25, hwnd, 1, hInst, NULL);
  209.                     timeV2 = CreateWindow("Time", "", TS_AUTOTIME | TS_SECONDS | WS_BORDER | WS_CHILD | WS_VISIBLE, 120, 80, 130, 25, hwnd, 1, hInst, NULL);
  210.                     HWND            timeV3 = CreateWindow("Time", "", TS_CLOCK | TS_SECONDS | WS_CHILD | WS_VISIBLE | ES_READONLY, 120, 110, 130, 25, hwnd, 1, hInst, NULL);
  211.                     HWND            timeV4 = CreateWindow("Time", "", TS_CLOCK | WS_CHILD | WS_VISIBLE | ES_READONLY, 120, 140, 130, 25, hwnd, 1, hInst, NULL);
  212.                     SetWindowHelp(timeV, 0x0075);
  213.                     SetWindowHelp(timeV1, 0x0076);
  214.                     SetWindowHelp(timeV2, 0x0077);
  215.                     SetWindowHelp(timeV3, 0x0078);
  216.                     SetWindowHelp(timeV4, 0x0079);
  217.  
  218.                     HWND            timeVS = CreateWindow("Static", "Time", WS_CHILD | WS_VISIBLE, 10, 20, 100, 25, hwnd, 1, hInst, NULL);
  219.                     HWND            timeV1S = CreateWindow("Static", "Time Seconds", WS_CHILD | WS_VISIBLE, 10, 50, 100, 30, hwnd, 1, hInst, NULL);
  220.                     HWND            timeV2S = CreateWindow("Static", "AutoTime", WS_CHILD | WS_VISIBLE, 10, 80, 100, 30, hwnd, 1, hInst, NULL);
  221.                     HWND            timeV3S = CreateWindow("Static", "Clock", WS_CHILD | WS_VISIBLE, 10, 110, 100, 30, hwnd, 1, hInst, NULL);
  222.                     HWND            timeV4S = CreateWindow("Static", "Clock", WS_CHILD | WS_VISIBLE, 10, 140, 100, 30, hwnd, 1, hInst, NULL);
  223.                     UpdateWindow(hwnd);
  224.                     mode = 4;
  225.                     return 0;
  226.                 }
  227.             case NUMBER:
  228.                 {
  229.                     DestroySubwindow(hwnd);
  230.                     PosNumber = CreateWindow("Number", "333,88", WS_BORDER | WS_CHILD | WS_VISIBLE, 120, 20, 100, 25, hwnd, 1, hInst, NULL);
  231.                     PosZeroNumber = CreateWindow("Number", "", WS_BORDER | WS_CHILD | WS_VISIBLE, 120, 50, 100, 25, hwnd, 1, hInst, NULL);
  232.                     NegNumber = CreateWindow("Number", "-333,88", WS_BORDER | WS_CHILD | WS_VISIBLE, 120, 80, 100, 25, hwnd, 1, hInst, NULL);
  233.                     SetWindowHelp(PosNumber, 0x0080);
  234.                     SetWindowHelp(PosZeroNumber, 0x0081);
  235.                     SetWindowHelp(NegNumber, 0x0082);
  236.                     NumberS = CreateWindow("Static", "Number", WS_CHILD | WS_VISIBLE, 10, 20, 100, 25, hwnd, 1, hInst, NULL);
  237.                     ZeroNumberS = CreateWindow("Static", "Zero Number", WS_CHILD | WS_VISIBLE, 10, 50, 100, 25, hwnd, 1, hInst, NULL);
  238.                     HWND            NegNumberS = CreateWindow("Static", "Neg Number", WS_CHILD | WS_VISIBLE, 10, 80, 100, 25, hwnd, 1, hInst, NULL);
  239.                     mode = 2;
  240.                     return 0;
  241.                 }
  242.             case ITALIAN:
  243.             case FRENCH:
  244.             case GERMAN:
  245.             case ENGLISH:
  246.             case SPANISH:
  247.             case PORTUGUESE:
  248.                 {
  249.                     struct intData *in = GetIntStructure();
  250.                     in->language = wParam;
  251.                     LoadMonthDays(intLib);
  252.                     return 0;
  253.                 }
  254.  
  255.             case DEMO:
  256.                 {
  257.                    if(Playback) 
  258.                     Playback("training\\Overall.tra");
  259.                 break;
  260.                 }
  261.  
  262.                 break;
  263.  
  264.             case CURRENCY_HELP:
  265.                 WinHelp(hwnd, ".\\help\\interlib.hlp", HELP_CONTEXT, 0X0035);
  266.                 break;
  267.             case NUMBER_HELP:
  268.                 WinHelp(hwnd, ".\\help\\interlib.hlp", HELP_CONTEXT, 0X0036);
  269.                 break;
  270.             case TIME_HELP:
  271.                 WinHelp(hwnd, ".\\help\\interlib.hlp", HELP_CONTEXT, 0X0038);
  272.                 break;
  273.             case DATE_HELP:
  274.                 WinHelp(hwnd, ".\\help\\interlib.hlp", HELP_CONTEXT, 0X0037);
  275.                 break;
  276.             case INTRODUCTION_HELP:
  277.                 WinHelp(hwnd, ".\\help\\interlib.hlp", HELP_CONTEXT, 0X0040);
  278.                 break;
  279.             case ABOUT_HELP:
  280.                 {
  281.                     MessageBox(NULL, "Internationalisation Library \012 Copyright Maurizio Maccani 1994", "About", MB_OK);
  282.                     return 0;
  283.                 }
  284.             case PRINT:
  285.                 {
  286.                     // Build a message Box witth the various details
  287.                     if (mode == 0)
  288.                         return 0;
  289.                     char            buff[40];
  290.                     LPSTR           message = (LPSTR) GlobalAllocPtr(GMEM_ZEROINIT, 512);
  291.                     if (mode == 3) {
  292.                         tm _far         tmIn;
  293.                         GetDateTm(date, &tmIn);
  294.                         time_t          t = GetDateTime_t(date);
  295.                         GetDateString(date, buff);
  296.                         lstrcat(message, "Short Date: ");
  297.                         lstrcat(message, buff);
  298.                         lstrcat(message, "\012\012");
  299.  
  300.                         GetLongDate(tmIn, buff);
  301.                         lstrcat(message, "long Date: ");
  302.                         lstrcat(message, buff);
  303.                         lstrcat(message, "\012\012");
  304.                         GetDayName(t, buff);
  305.                         lstrcat(message, "Day Name: ");
  306.                         lstrcat(message, buff);
  307.                         lstrcat(message, "\012\012");
  308.                         GetMonthName(t, buff);
  309.                         lstrcat(message, "Month Name: ");
  310.                         lstrcat(message, buff);
  311.                         lstrcat(message, "\012\012");
  312.                     }
  313.                     if (mode == 1) {
  314.                         long            PosDollar = GetDollar(PosCurrency);
  315.                         int             PosCentimes = GetCentimes(PosCurrency);
  316.  
  317.                         ltoa(PosDollar, buff, 10);
  318.                         lstrcat(message, "Pos Curr. Dollar Amount: ");
  319.                         lstrcat(message, buff);
  320.                         lstrcat(message, "\012\012");
  321.  
  322.                         itoa(PosCentimes, buff, 10);
  323.                         lstrcat(message, "Pos.Curr. Centimes Amount: ");
  324.                         lstrcat(message, buff);
  325.                         lstrcat(message, "\012\012");
  326.  
  327.                         long            PosZeroDollar = GetDollar(PosZeroCurrency);
  328.                         int             PosZeroCentimes = GetCentimes(PosZeroCurrency);
  329.  
  330.                         ltoa(PosZeroDollar, buff, 10);
  331.                         lstrcat(message, "Pos. 0 Curr. Dollar Amount: ");
  332.                         lstrcat(message, buff);
  333.                         lstrcat(message, "\012\012");
  334.  
  335.                         itoa(PosZeroCentimes, buff, 10);
  336.                         lstrcat(message, "Pos.0 Curr. Centimes: ");
  337.                         lstrcat(message, buff);
  338.                         lstrcat(message, "\012\012");
  339.  
  340.                         long            NegDollar = GetDollar(NegCurrency);
  341.                         int             NegCentimes = GetCentimes(NegCurrency);
  342.  
  343.                         ltoa(NegDollar, buff, 10);
  344.                         lstrcat(message, "Neg Curr. Dollar Amount: ");
  345.                         lstrcat(message, buff);
  346.                         lstrcat(message, "\012\012");
  347.  
  348.                         itoa(NegCentimes, buff, 10);
  349.                         lstrcat(message, "Neg. Curr. Centimes: ");
  350.                         lstrcat(message, buff);
  351.                         lstrcat(message, "\012\012");
  352.  
  353.                         long            NegZeroDollar = GetDollar(NegZeroCurrency);
  354.                         int             NegZeroCentimes = GetCentimes(NegZeroCurrency);
  355.  
  356.                         ltoa(NegZeroDollar, buff, 10);
  357.                         lstrcat(message, "Neg.0 Curr. Dollar Amount: ");
  358.                         lstrcat(message, buff);
  359.                         lstrcat(message, "\012\012");
  360.  
  361.                         itoa(NegZeroCentimes, buff, 10);
  362.                         lstrcat(message, "Neg.0 Curr. Centimes: ");
  363.                         lstrcat(message, buff);
  364.                         lstrcat(message, "\012\012");
  365.                     }
  366.                     if (mode == 2) {
  367.                         long            PosNumberV = GetInteger(PosNumber);
  368.                         long            PosFraction = GetFraction(PosNumber);
  369.  
  370.                         ltoa(PosNumberV, buff, 10);
  371.                         lstrcat(message, "Pos Number: ");
  372.                         lstrcat(message, buff);
  373.                         lstrcat(message, "\012\012");
  374.  
  375.                         ltoa(PosFraction, buff, 10);
  376.                         lstrcat(message, "Pos.  Fraction: ");
  377.                         lstrcat(message, buff);
  378.                         lstrcat(message, "\012\012");
  379.  
  380.                         long            PosZeroNumberV = GetInteger(PosZeroNumber);
  381.                         long            PosZeroFraction = GetFraction(PosZeroNumber);
  382.  
  383.                         ltoa(PosZeroNumberV, buff, 10);
  384.                         lstrcat(message, "Pos. 0 Number: ");
  385.                         lstrcat(message, buff);
  386.                         lstrcat(message, "\012\012");
  387.  
  388.                         ltoa(PosZeroFraction, buff, 10);
  389.                         lstrcat(message, "Pos.0 Fraction: ");
  390.                         lstrcat(message, buff);
  391.                         lstrcat(message, "\012\012");
  392.  
  393.                         long            NegNumberV = GetInteger(NegNumber);
  394.                         long            NegFraction = GetFraction(NegNumber);
  395.  
  396.                         ltoa(NegNumberV, buff, 10);
  397.                         lstrcat(message, "Negative Number: ");
  398.                         lstrcat(message, buff);
  399.                         lstrcat(message, "\012\012");
  400.  
  401.                         ltoa(NegFraction, buff, 10);
  402.                         lstrcat(message, "Negative Fraction: ");
  403.                         lstrcat(message, buff);
  404.                         lstrcat(message, "\012\012");
  405.  
  406.                     }
  407.                     if (mode == 4) {
  408.                         int             hours = GetHours(timeV);
  409.                         int             minutes = GetMinutes(timeV);
  410.                         int             seconds = GetSeconds(timeV);
  411.                         itoa(hours, buff, 10);
  412.                         lstrcat(message, "Base Hours: ");
  413.                         lstrcat(message, buff);
  414.                         lstrcat(message, "\012\012");
  415.  
  416.                         itoa(minutes, buff, 10);
  417.                         lstrcat(message, "Base Minutes: ");
  418.                         lstrcat(message, buff);
  419.                         lstrcat(message, "\012\012");
  420.  
  421.                         hours = GetHours(timeV1);
  422.                         minutes = GetMinutes(timeV1);
  423.                         seconds = GetSeconds(timeV1);
  424.                         itoa(hours, buff, 10);
  425.                         lstrcat(message, "Base with Seconds Hours: ");
  426.                         lstrcat(message, buff);
  427.                         lstrcat(message, "\012\012");
  428.  
  429.                         itoa(minutes, buff, 10);
  430.                         lstrcat(message, "Base with Seconds Minutes: ");
  431.                         lstrcat(message, buff);
  432.                         lstrcat(message, "\012\012");
  433.  
  434.                         itoa(seconds, buff, 10);
  435.                         lstrcat(message, "Base with Seconds Seconds: ");
  436.                         lstrcat(message, buff);
  437.                         lstrcat(message, "\012\012");
  438.                     }
  439.                     MessageBox(hwnd, message, "You inserted", MB_OK);
  440.                     GlobalFreePtr(message);
  441.                     return 0;
  442.                 }
  443.             }
  444.         }
  445.     }
  446.     return DefWindowProc(hwnd, message, wParam, lParam);
  447. }
  448.  
  449. void            DestroySubwindow(HWND hwnd)
  450. {
  451.     FARPROC         findChildWindowsProc = MakeProcInstance((FARPROC) FindChildWindowsProc, (HINSTANCE) GetWindowWord(hwnd, GWW_HINSTANCE));
  452.     EnumChildWindows(hwnd, (WNDENUMPROC) findChildWindowsProc, (LPARAM) NULL);
  453.     return;
  454. }
  455. BOOL CALLBACK _export FindChildWindowsProc(HWND hwnd, LPARAM list)
  456. {
  457.     DestroyWindow(hwnd);
  458.     return TRUE;
  459. }
  460. BOOL FAR PASCAL __export TestDialogProc(HWND hDlg, UINT uMsg,
  461.                                                WPARAM wParam, LPARAM lParam)
  462. {
  463.     switch (uMsg) {
  464.  case WM_INITDIALOG:
  465.         {
  466.             SetWindowHelp(hDlg, 0x0085);
  467.             SetWindowHelp(GetDlgItem(hDlg, 1), 0x0095);
  468.             SetWindowHelp(GetDlgItem(hDlg, 2), 0x0096);
  469.             SetWindowHelp(GetDlgItem(hDlg, 3), 0x0097);
  470.             SetWindowHelp(GetDlgItem(hDlg, 4), 0x0098);
  471.             SetWindowHelp(GetDlgItem(hDlg, 5), 0x0099);
  472.             SetWindowHelp(GetDlgItem(hDlg, 6), 0x0100);
  473.             SetWindowHelp(GetDlgItem(hDlg, 7), 0x0101);
  474.             return TRUE;
  475.         }
  476.     case WM_CLOSE:
  477.         EndDialog(hDlg, 0);
  478.         return TRUE;
  479.     case WM_COMMAND:
  480.         switch (wParam) {
  481.         case ID_OK:
  482.             EndDialog(hDlg, 0);
  483.             return TRUE;
  484.         default:
  485.             break;
  486.         }
  487.         break;
  488.     }
  489.     return (FALSE);
  490.  
  491. }                               // end of TestDialogProc()
  492.  
  493. BOOL FAR PASCAL __export TestDialog1Proc(HWND hDlg, UINT uMsg,
  494.                                                WPARAM wParam, LPARAM lParam)
  495. {
  496.     switch (uMsg) {
  497.  case WM_INITDIALOG:
  498.         {
  499.             SetWindowHelp(GetDlgItem(hDlg, 1), 0x0090);
  500.             SetWindowHelp(GetDlgItem(hDlg, 2), 0x0091);
  501.             SetWindowHelp(GetDlgItem(hDlg, 3), 0x0092);
  502.             SetWindowHelp(GetDlgItem(hDlg, 4), 0x0093);
  503.             SetWindowHelp(GetDlgItem(hDlg, 5), 0x0094);
  504.             SetDollar(GetDlgItem(hDlg, 1), 10);
  505.             SetCentimes(GetDlgItem(hDlg, 1), 5);
  506.             SetSign(GetDlgItem(hDlg, 1), FALSE);        // Set the sign as
  507.                                                         // positive
  508.             SetInteger(GetDlgItem(hDlg, 2), 99);
  509.             SetFraction(GetDlgItem(hDlg, 2), 34);
  510.             SetSign(GetDlgItem(hDlg, 2), TRUE); // Set the sign as negative
  511.             SetDateString(GetDlgItem(hDlg, 3), "03 3 94");
  512.             SetHours(GetDlgItem(hDlg, 4), 10);
  513.             SetMinutes(GetDlgItem(hDlg, 4), 20);
  514.             SetHours(GetDlgItem(hDlg, 5), 11);
  515.             SetMinutes(GetDlgItem(hDlg, 5), 22);
  516.             SetSeconds(GetDlgItem(hDlg, 5), 33);
  517.             return TRUE;
  518.         }
  519.     case WM_CLOSE:
  520.         EndDialog(hDlg, 0);
  521.         return TRUE;
  522.     case WM_COMMAND:
  523.         switch (wParam) {
  524.         case ID_OK:
  525.             EndDialog(hDlg, 0);
  526.             return TRUE;
  527.         default:
  528.             break;
  529.         }
  530.         break;
  531.     }
  532.     return (FALSE);
  533.  
  534. }                               // end of TestDialog1Proc()
  535.  
  536. BOOL FAR PASCAL __export ShowDetailsDialogProc(HWND hDlg, UINT uMsg,
  537.                                                WPARAM wParam, LPARAM lParam)
  538. {
  539.     switch (uMsg) {
  540.  case WM_INITDIALOG:
  541.         {
  542.             struct intData *in = GetIntStructure();
  543.             SetWindowHelp(hDlg, 0x0047);
  544.             SetDlgItemText(hDlg, 3, in->loMonths[0]);
  545.             SetDlgItemText(hDlg, 4, in->loMonths[1]);
  546.             SetDlgItemText(hDlg, 5, in->loMonths[2]);
  547.             SetDlgItemText(hDlg, 6, in->loMonths[3]);
  548.             SetDlgItemText(hDlg, 7, in->loMonths[4]);
  549.             SetDlgItemText(hDlg, 8, in->loMonths[5]);
  550.             SetDlgItemText(hDlg, 9, in->loMonths[6]);
  551.             SetDlgItemText(hDlg, 10, in->loMonths[7]);
  552.             SetDlgItemText(hDlg, 11, in->loMonths[8]);
  553.             SetDlgItemText(hDlg, 12, in->loMonths[9]);
  554.             SetDlgItemText(hDlg, 13, in->loMonths[10]);
  555.             SetDlgItemText(hDlg, 14, in->loMonths[11]);
  556.             SetDlgItemText(hDlg, 15, in->loDays[0]);
  557.             SetDlgItemText(hDlg, 16, in->loDays[1]);
  558.             SetDlgItemText(hDlg, 17, in->loDays[2]);
  559.             SetDlgItemText(hDlg, 18, in->loDays[3]);
  560.             SetDlgItemText(hDlg, 19, in->loDays[4]);
  561.             SetDlgItemText(hDlg, 20, in->loDays[5]);
  562.             SetDlgItemText(hDlg, 21, in->loDays[6]);
  563.             if (!in->shortMonth)
  564.                 SetDlgItemText(hDlg, 29, "N");
  565.             if (!in->shortDay)
  566.                 SetDlgItemText(hDlg, 30, "N");
  567.             if (!in->shortYear)
  568.                 SetDlgItemText(hDlg, 31, "N");
  569.             switch (in->dateFormat) {
  570.             case 0:
  571.                 SetDlgItemText(hDlg, 74, "MDY");
  572.                 break;
  573.             case 1:
  574.                 SetDlgItemText(hDlg, 74, "DMY");
  575.                 break;
  576.             case 2:
  577.                 SetDlgItemText(hDlg, 74, "YMD");
  578.                 break;
  579.             }
  580.             SetDlgItemText(hDlg, 44, in->longDateFirstSeparator);
  581.             SetDlgItemText(hDlg, 45, in->longDateSecondSeparator);
  582.             SetDlgItemText(hDlg, 46, in->longDateThirdSeparator);
  583.             char            shDateS[2];
  584.             shDateS[0] = in->dateSeparator;
  585.             shDateS[1] = 0;
  586.             SetDlgItemText(hDlg, 75, shDateS);
  587.             switch (in->longDateMonthFormat) {
  588.             case 1:
  589.                 SetDlgItemText(hDlg, 38, "3");
  590.                 break;
  591.             case 2:
  592.                 SetDlgItemText(hDlg, 38, "03");
  593.                 break;
  594.             case 3:
  595.                 SetDlgItemText(hDlg, 38, in->shMonths[2]);
  596.                 break;
  597.             case 4:
  598.                 SetDlgItemText(hDlg, 38, in->loMonths[2]);
  599.                 break;
  600.             }
  601.             switch (in->longDateWeekDayFormat) {
  602.             case 3:
  603.                 SetDlgItemText(hDlg, 40, in->shDays[2]);
  604.                 break;
  605.             case 4:
  606.                 SetDlgItemText(hDlg, 40, in->loDays[2]);
  607.                 break;
  608.             }
  609.             switch (in->longDateDayFormat) {
  610.             case 1:
  611.                 SetDlgItemText(hDlg, 37, "3");
  612.                 break;
  613.             case 2:
  614.                 SetDlgItemText(hDlg, 37, "03");
  615.                 break;
  616.             }
  617.             switch (in->longDateYearFormat) {
  618.             case 2:
  619.                 SetDlgItemText(hDlg, 39, "94");
  620.                 break;
  621.             case 4:
  622.                 SetDlgItemText(hDlg, 39, "1994");
  623.                 break;
  624.             }
  625.             SetDlgItemText(hDlg, 53, in->sTime);
  626.             SetDlgItemText(hDlg, 55, in->am);
  627.             SetDlgItemText(hDlg, 57, in->pm);
  628.             switch (in->iTime) {
  629.             case 0:
  630.                 SetDlgItemText(hDlg, 54, "0-12");
  631.                 break;
  632.             case 1:
  633.                 SetDlgItemText(hDlg, 54, "0-24");
  634.                 break;
  635.             }
  636.             switch (in->iTLZero) {
  637.             case 0:
  638.                 SetDlgItemText(hDlg, 56, "03:02 am");
  639.                 break;
  640.             case 1:
  641.                 SetDlgItemText(hDlg, 56, "3:2 pm");
  642.                 break;
  643.             }
  644.             SetDlgItemText(hDlg, 64, in->SZCurrency);
  645.             switch (in->iNegCurr) {
  646.             case 0:
  647.                 SetDlgItemText(hDlg, 66, "($12,2)");
  648.                 break;
  649.             case 1:
  650.                 SetDlgItemText(hDlg, 66, "-$12,22");
  651.                 break;
  652.             case 2:
  653.                 SetDlgItemText(hDlg, 66, "$-12,22");
  654.                 break;
  655.             case 3:
  656.                 SetDlgItemText(hDlg, 66, "$12,22-");
  657.                 break;
  658.             case 4:
  659.                 SetDlgItemText(hDlg, 66, "(12,22$)");
  660.                 break;
  661.             case 5:
  662.                 SetDlgItemText(hDlg, 66, "-12,22$");
  663.                 break;
  664.             case 6:
  665.                 SetDlgItemText(hDlg, 66, "12,22-$");
  666.                 break;
  667.             case 7:
  668.                 SetDlgItemText(hDlg, 66, "12,22$-");
  669.                 break;
  670.             case 8:
  671.                 SetDlgItemText(hDlg, 66, "-12,22 $");
  672.                 break;
  673.             case 9:
  674.                 SetDlgItemText(hDlg, 66, "-$ 12,22");
  675.                 break;
  676.             case 10:
  677.                 SetDlgItemText(hDlg, 66, "12,22 $-");
  678.                 break;
  679.             }
  680.             switch (in->iCurrency) {
  681.             case 0:
  682.                 SetDlgItemText(hDlg, 67, "$12,22");
  683.                 break;
  684.             case 1:
  685.                 SetDlgItemText(hDlg, 67, "12,22$");
  686.                 break;
  687.             case 2:
  688.                 SetDlgItemText(hDlg, 67, "$ 12,22");
  689.                 break;
  690.             case 3:
  691.                 SetDlgItemText(hDlg, 67, "12,22 $");
  692.                 break;
  693.             }
  694.             SetDlgItemInt(hDlg, 65, in->iCurrDigits, FALSE);
  695.             SetDlgItemText(hDlg, 68, in->iThousand);
  696.             SetDlgItemText(hDlg, 69, in->iDecimal);
  697.             switch (in->language) {
  698.             case DANISH:
  699.                 SetDlgItemText(hDlg, 70, "Danish");
  700.                 break;
  701.             case FINNISH:
  702.                 SetDlgItemText(hDlg, 70, "Finnish");
  703.                 break;
  704.             case FRENCH:
  705.                 SetDlgItemText(hDlg, 70, "French");
  706.                 break;
  707.             case ENGLISH:
  708.                 SetDlgItemText(hDlg, 70, "English");
  709.                 break;
  710.             case ICELAND:
  711.                 SetDlgItemText(hDlg, 70, "Iceland");
  712.                 break;
  713.             case ITALIAN:
  714.                 SetDlgItemText(hDlg, 70, "Italian");
  715.                 break;
  716.             case NORWEGIAN:
  717.                 SetDlgItemText(hDlg, 70, "NORWEGIAN");
  718.                 break;
  719.             case DUTCH:
  720.                 SetDlgItemText(hDlg, 70, "Dutch");
  721.                 break;
  722.             case PORTUGUESE:
  723.                 SetDlgItemText(hDlg, 70, "Portuguese");
  724.                 break;
  725.             case SWEDISH:
  726.                 SetDlgItemText(hDlg, 70, "Swedish");
  727.                 break;
  728.             case SPANISH:
  729.                 SetDlgItemText(hDlg, 70, "Spanish");
  730.                 break;
  731.             case GERMAN:
  732.                 SetDlgItemText(hDlg, 70, "German");
  733.                 break;
  734.             }
  735.             return TRUE;
  736.         }
  737.     case WM_CLOSE:
  738.         EndDialog(hDlg, 0);
  739.         return TRUE;
  740.  
  741.     case WM_COMMAND:
  742.         switch (wParam) {
  743.         case 100:
  744.             EndDialog(hDlg, 0);
  745.             return TRUE;
  746.  
  747.         default:
  748.             break;
  749.         }
  750.         break;
  751.     }
  752.     return (FALSE);
  753.  
  754. }                               // end of TestDialogProc()
  755.  
  756.